<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/js/jQuery3.6.0.js" type="text/javascript"></script>
    <script>
        window.onload = function () {
            // document.getElementById("name").innerText = "顾建宇"
            getUser();
        }

        function getUser() {
            $.ajax({
                url: '/getUser',
                success: function (user) {
                    document.getElementById("name").innerText = user.name
                    document.getElementById("schoolId").innerText = user.schoolId;
                },
                error: function () {
                    alert("失败");
                }
            })
        }
    </script>
</head>
<body>
<h1>姓名:<span id="name"></span></h1>
<h1>学号:<span id="schoolId"></span></h1>
</body>
</html>